App({
    onLaunch(options) {
        console.group('AppOnLaunch')
        this.globalData.systemInfo = wx.getSystemInfoSync()
        console.log('系统信息：', this.globalData.systemInfo)
        console.groupEnd()
    },
    globalData: {
        // 系统信息
        systemInfo: {},
    },
    scanCode() {
        console.group('扫码')
        wx.scanCode({
            success: res => {
                console.log('扫码', res)
                if (['QR_CODE', 'WX_CODE'].includes(res.scanType) && res.path) {
                    let url = res.path
                    this.mdFn({
                        eventDesc: '扫码',
                        eventId: '扫码',
                        eventValue: url
                    })
                    if (url.substring(0, 1) === '/') {
                        wx.navigateTo({
                            url: res.path,
                        })
                    } else {
                        wx.navigateTo({
                            url: '/' + res.path,
                        })
                    }
                }
                console.groupEnd()
            },
            fail: e => {
                console.log(e)
            }
        })
    },
    onShow(options) {
    },
    onHide() {
    },
})
